#include<iostream>
#include<map>
#include<string>
using namespace std;
map<string, char>mp;
int main()
{
	mp["01"] = 'A';
	mp["1000"] = 'B';
	mp["1010"] = 'C';
	mp["100"] = 'D';
	mp["0"] = 'E';
	mp["0010"] = 'F';
	mp["110"] = 'G';
	mp["0000"] = 'H';
	mp["00"] = 'I';
	mp["0111"] = 'J';
	mp["101"] = 'K';
	mp["0100"] = 'L';
	mp["11"] = 'M';
	mp["10"] = 'N';
	mp["111"] = 'O';
	mp["0110"] = 'P';
	mp["1101"] = 'Q';
	mp["010"] = 'R';
	mp["000"] = 'S';
	mp["1"] = 'T';
	mp["001"] = 'U';
	mp["0001"] = 'V';
	mp["011"] = 'W';
	mp["1001"] = 'X';
	mp["1011"] = 'Y';
	mp["1100"] = 'Z';
	mp["01111"] = '1';
	mp["00111"] = '2';
	mp["00011"] = '3';
	mp["00001"] = '4';
	mp["00000"] = '5';
	mp["10000"] = '6';
	mp["11000"] = '7';
	mp["11100"] = '8';
	mp["11110"] = '9';
	mp["11111"] = '0';
	mp["001100"] = '?';
	mp["10010"] = '/';
	mp["100001"] = '-';
	mp["010101"] = '.';


	string s, temp;
	cin >> s;
	string ans;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] != '.') {
			temp += s[i];
		}
		else {
			if (temp == "101101")ans += "()";
			else ans += mp[temp];
			temp = "";
		}
	}
	ans += mp[temp];
	cout << ans << endl;
	return 0;
}